﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ParamObj : MonoBehaviour {

    public int Band;
    private float startScale = 1.0f;
    private float scaleMultiplier = 1.5f;

    private float temp;

    private Image image;
    void Start()
    {
        this.image = this.GetComponent<Image>();
    }

    // Update is called once per frame
    void Update()
    {
        this.temp = (AudioVisable.AudioBandBuffer[this.Band]) * this.scaleMultiplier + this.startScale;
        if (float.IsNaN(this.temp))
        {
            return;
        }

        this.transform.localScale = new Vector3(this.transform.localScale.x,
            this.temp,
            this.transform.localScale.z);

        Color color = new Color(AudioVisable.AudioBandBuffer[this.Band], AudioVisable.AudioBandBuffer[this.Band],
            AudioVisable.AudioBandBuffer[this.Band]);
        this.image.color = color;
    }
}
